package hrc.tool;

/**
 * this class is a tool for the tranlate between two different encoding
 * 
 * @author hrc
 * 
 */
public class CharEncoding {
	public static String decode(String str, String charSet) {
		try {
			return new String(str.getBytes("ISO-8859-1"), charSet);
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	}

	public static String[] decode(String[] str, String charSet) {
		try {
			for (int i = 0; i < str.length; i++) {
				str[i] = new String(str[i].getBytes("ISO-8859-1"), charSet);
			}
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
		return str;
	}
}
